<header>
  <div class="right">
    时间：
    <span>
      <p-calendar [locale]="en" [(ngModel)]="startTime"></p-calendar>
    </span>
    <span>
      <button (click)="onSearch()">查询</button>
    </span>
  </div>
</header>
<main>
  <p-table [columns]="cols" [value]="data" [paginator]="true" [rows]="rows" [showCurrentPageReport]="true" [resizableColumns]="true" [(first)]="firstDay"
           currentPageReportTemplate="显示 {{firstDay}} 到 {{firstDay+rows}} 共 {{data.length}} 记录">
    <ng-template pTemplate="header" let-columns>
      <tr class="data-columns">
        <th style="width:10%;text-align: left" pResizableColumn>风场</th>
        <th style="width:10%;text-align: left" pResizableColumn>{{nowDayStr}}实际发电量</th>
        <th style="width:10%;text-align: left" pResizableColumn>{{nowDayStr}}预测</th>
        <th style="width:10%;text-align: left" pResizableColumn>{{firstDayStr}}预测</th>
        <th style="width:10%;text-align: left" pResizableColumn>{{secondDayStr}}预测</th>
        <!--<th style="width:10%;text-align: left" pResizableColumn>{{thirdDayStr}}预测</th>-->
      </tr>
    </ng-template>
    <ng-template pTemplate="body" let-row let-columns="columns">
      <tr class="data-rows">
        <td class="ui-resizable-column">{{row.plantName}}</td>
        <!--<td class="ui-resizable-column">{{row.date}}</td>-->
        <!--<td class="ui-resizable-column">{{row.tbmodel}}</td>-->
        <td class="ui-resizable-column">{{+row.genpow && +row.genpow.toFixed(5)}}</td>
        <td class="ui-resizable-column">{{+row.nowPower && +row.nowPower.toFixed(5)}}</td>
        <td class="ui-resizable-column">{{+row.firstPower && +row.firstPower.toFixed(5)}}</td>
        <td class="ui-resizable-column">{{+row.secondPower && +row.secondPower.toFixed(5)}}</td>
        <!--<td class="ui-resizable-column">{{+row.thirdPower && +row.thirdPower.toFixed(5)}}</td>-->
      </tr>
    </ng-template>
    <ng-template pTemplate="emptymessage" let-columns>
      <tr>
        <td [attr.colspan]="columns.length" style="text-align: center">
          没有数据
        </td>
      </tr>
    </ng-template>
  </p-table>
</main>
<p-confirmDialog header="Confirmation" width="300" acceptLabel="是" rejectLabel="否"></p-confirmDialog>
